// 我的-业主功能 相关接口

import request from '@/utils/request'

// 业主账单列表
export function ownerBillList(query) {
    return request({
        url: '/front/flat/bill/proprietor/list',
        method: 'get',
        params: query
    })
}

// 业主账单详情
export function ownerBillDetail(id) {
    return request({
        url: '/front/flat/bill/proprietor/' + id,
        method: 'get'
    })
}

// 业主账单支付
export function ownerBillPay(billId,payType) {
    return request({
        url: '/front/flat/bill/proprietor/pay/' + billId+'/'+payType,
        method: 'get',
    })
}

// 租客合同分页查询
// 合同类型:1.个人纸质合同;2.企业纸质合同;3.个人电子合同
export function tenantContractList(query) {
    return request({
        url: '/front/flat/contract/lesseeContract/proprietor/list',
        method: 'get',
        params: query
    })
}

// 查看纸质租客合同详情
export function tenantPaperContractDetail(contractId) {
    return request({
        url: '/front/flat/contract/lesseeContract/' + contractId,
        method: 'get'
    })
}

// 预览电子合同
export function tenantEleContractPreview(data) {
    return request({
        url: '/front/flat/contract/lesseeContract/previewUrl',
        method: 'post',
        data
    })
}

// 确认租客合同
export function confirmTenantContract(contractId) {
    return request({
        url: '/front/flat/contract/lesseeContract/confirm/' + contractId,
        method: 'put',
    })
}

// 撤销租客合同
export function repealTenantContract(contractId) {
    return request({
        url: '/front/flat/contract/lesseeContract/repeal',
        method: 'put',
        data: {
            lesseeContractId: contractId
        }
    })
}

// 删除租客合同
export function deleteTenantContract(contractId) {
    return request({
        url: '/front/flat/contract/lesseeContract/' + contractId,
        method: 'delete'
    })
}

// 租客合同签约
export function tenantContractSigning(data) {
    return request({
        url: '/front/flat/contract/lesseeContract/proprietor/signing',
        method: 'post',
        data
    })
}

// 分页查询业主合同列表
export function ownerContractList(query) {
    return request({
        url: '/front/flat/contract/proprietorContract/list',
        method: 'get',
        params: query
    })
}

// 查看业主合同详情
export function ownerContractDetail(contractId) {
    return request({
        url: '/front/flat/contract/proprietorContract/' + contractId,
        method: 'get'
    })
}

// 删除业主合同
export function deleteOwnerContract(contractId) {
    return request({
        url: '/front/flat/contract/proprietorContract/' + contractId,
        method: 'delete'
    })
}

//预览业主电子合同
export function ownerEleContractPreview(data) {
    return request({
        url: '/front/flat/contract/proprietorContract/previewUrl',
        method: 'post',
        data
    })
}

// 签署业主合同
export function ownerContractSigning(data) {
    return request({
        url: '/front/flat/contract/proprietorContract/signing',
        method: 'put',
        data
    })
}

// 业主信息
export function ownerInfo() {
    return request({
        url: '/front/flat/contract/proprietor',
        method: 'get'
    })
}
